home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1995 June / MacFormat 25.iso / Shareware City / Developers / OutOfPhase1.1 Source / OutOfPhase Folder / ASTUnaryOperator.h < prev    next >
Text File  |  1994-07-17  |  2KB  |  71 lines

  1. /* ASTUnaryOperator.h */
  2.  
  3. #ifndef Included_ASTUnaryOperator_h
  4. #define Included_ASTUnaryOperator_h
  5.  
  6. /* ASTUnaryOperator module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* ASTExpression */
  12. /* TrashTracker */
  13. /* Memory */
  14. /* PcodeObject */
  15. /* CompilerRoot */
  16. /* PromotableTypeCheck */
  17.  
  18. #include "PcodeObject.h"
  19. #include "CompilerRoot.h"
  20.  
  21. struct ASTUnaryOpRec;
  22. typedef struct ASTUnaryOpRec ASTUnaryOpRec;
  23.  
  24. /* all memory allocated from this module is created from TrashTracker */
  25.  
  26. typedef enum
  27.     {
  28.         eUnaryNegation EXECUTE(= -1252),
  29.         eUnaryNot,
  30.         eUnarySine,
  31.         eUnaryCosine,
  32.         eUnaryTangent,
  33.         eUnaryArcSine,
  34.         eUnaryArcCosine,
  35.         eUnaryArcTangent,
  36.         eUnaryLogarithm,
  37.         eUnaryExponentiation,
  38.         eUnaryCastToBoolean,
  39.         eUnaryCastToInteger,
  40.         eUnaryCastToSingle,
  41.         eUnaryCastToDouble,
  42.         eUnaryCastToFixed,
  43.         eUnarySquare,
  44.         eUnarySquareRoot,
  45.         eUnaryAbsoluteValue,
  46.         eUnaryTestNegative,
  47.         eUnaryGetSign,
  48.         eUnaryGetArrayLength
  49.     } UnaryOpType;
  50.  
  51. /* forwards */
  52. struct TrashTrackRec;
  53. struct ASTExpressionRec;
  54.  
  55. /* create a unary operator node */
  56. ASTUnaryOpRec*    NewUnaryOperator(UnaryOpType WhatOperation,
  57.                                     struct ASTExpressionRec* Argument, struct TrashTrackRec* TrashTracker,
  58.                                     long LineNumber);
  59.  
  60. /* type check the unary operator node.  this returns eCompileNoError if */
  61. /* everything is ok, and the appropriate type in *ResultingDataType. */
  62. CompileErrors        TypeCheckUnaryOperator(DataTypes* ResultingDataType,
  63.                                     ASTUnaryOpRec* UnaryOperator, long* ErrorLineNumber,
  64.                                     struct TrashTrackRec* TrashTracker);
  65.  
  66. /* generate code for a unary operator. returns True if successful, or False if it fails. */
  67. MyBoolean                CodeGenUnaryOperator(struct PcodeRec* FuncCode,
  68.                                     long* StackDepthParam, ASTUnaryOpRec* UnaryOperator);
  69.  
  70. #endif
  71.